var obj = {
  _age: 18
}

Object.defineProperties(obj, {
  name: {
    configurable: true,
    enumerable:true,
    writable:true,
    value: 'halo'
  },
})
// 获取属性的描述符
console.log(Object.getOwnPropertyDescriptor(obj, "name"));

// 获取对象所有属性描述符
console.log(Object.getOwnPropertyDescriptors(obj));